﻿/**
*增加诚意金
*/
Chenxin.UI.AddMoneyForm = Chenxin.extend(Chenxin.UI.FormCommon,{
    actionUrl:'/service/logic/ShowListIntent.ashx',
    id:'AddMoney',
    renderTo:'divAddMoney',
    winCls:'',
    jqmWidth:560,
    defBBtn:true,
    createForm: function() {
        return Chenxin.FormCommon.AddMoneyForm(this.id);
    },
    initEvent: function() {
        var _this = this;
        var thisid='#'+this.id;	
		_this.isclick = true;
		
		$(thisid+'_save').live('click',function(){			
		    if(_this.isclick)
		    {
			    _this.save();
			}
		});
		$(thisid+'_cancle').live('click',function(){			
			_this.hide();
		});
    },
    initFormValidator:function(){
        //增加诚意金
        $("#AddedMoney").formValidator({
            validatorgroup: this.id,
            onshow: "请输入金额！",
            onfocus: "请输入金额！",
            oncorrect: "输入正确"
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "不能为空！"
            },
            onerror: "不能为空！"
        }).functionValidator({ //数字验证
            fun: function(val, elem) {
                val = Chenxin.Fn.fullToHalfChar(val);
                if (parseInt(val) <0) {
                    return false;
                }
                else {
                    return val.isNum();
                }
            },
            onerror: "请输入非0数字"
        });;
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.AddMoneyForm.superclass.initComponent.call(this);
    }
});

Chenxin.FormCommon.AddMoneyForm=function(formID){
return '<table class="tbl_f"><tr id = "mmid"><th style="width:100px;">意向书编号：</th><td><input type="hidden"  name="IntentionId" /><input type="text" class="inputbox_n fl" name="IntentionCode" readonly="readonly" class="inputbox_n fl"  style="width:160px;"/></td><th style="width:100px;">领取业务员：</th><td><input type="text"  class="inputbox_n fl"  style="width:160px;" name="LastEmployee"  readonly="readonly"  style="width:70px;"/></td></tr><tr><th>建档日期：</th><td><input type="text" name="CreateDate" class="inputbox_n fl"  style="width:160px;"  readonly="readonly" /></td><th>建档人员：</th><td><input type="text" name="CreateEmp" readonly="readonly" class="inputbox_n fl"  style="width:160px;"/></td></tr><tr><th>物件地址：</th><td colspan="3"><input type="text" name="HouseAddress" readonly="readonly" class="inputbox_n fl" style="width:433px;"/></td></tr><tr><th>房屋价格：</th><td colspan="3"><input type="text" name="TotalPrice" readonly="readonly" class="inputbox_n fl"  style="width:160px;"/></td></tr><tr><th>房东姓名：</th><td><input type="text" class="inputbox_n fl" name="CustomerName_Sale" readonly="readonly" style="width:160px;"/></td><th>客户姓名：</th><td><input type="text" name="CustomerName_Buy" class="inputbox_n fl" readonly="readonly" style="width:160px;"/></td></tr><tr><th>首笔诚意金额：</th><td><input type="text" name="FirstMoney" class="inputbox_n fl" readonly="readonly" style="width:160px;"/></td><th>诚意金总额：</th><td><input type="text" name="TotalMoney" class="inputbox_n fl" readonly="readonly" style="width:160px;"/></td></tr><tr><th>增加金额：</th><td colspan="3"><input type="text" class="inputbox_n fl" id="AddedMoney" name="AddedMoney" style="width:160px;"/><div id="AddedMoneyTip" style="margin-left: 5px; width: 100px; float:left;text-align: left;" class="fl"></div></td></tr></table>';
};